package com.beici.seoserver.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.beici.seoserver.model.classBox.classboxNode;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @auther WaterGhost
 * @date 2022/3/22 19:39
 */
public interface classboxNodeMapper extends BaseMapper<classboxNode> {
    @Select("select cb.cb_id,cb.cb_name,cb.cb_mess,cb.cb_top,u.user_name,u.user_header from classbox_node cb join user u on cb.cb_user_id = u.user_id order by cb_top desc limit 80")
    List<classboxNode> selectAll();

    @Select("select cb.cb_id,cb.cb_name,cb.cb_mess,cb_date,cb_look,cb_context,cb_user_id,cb_sercurity_score,u.user_name,u.user_mess,u.user_header from classbox_node cb join user u on cb.cb_user_id = u.user_id where cb.cb_id = #{cbId}")
    classboxNode selectNodeBycbId(Long cbId);
}
